#ifndef ILEXER_H
#define ILEXER_H

#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
  enum { dvOriginal = 0, dvLineEnd = 1 };
  class IDocument {
    public:
      virtual int  Version() const = 0;
      virtual void  SetErrorStatus( int status ) = 0;
      virtual int  Length() const = 0;
      virtual void  GetCharRange( char *buffer, int position, int lengthRetrieve ) const = 0;
      virtual char  StyleAt( int position ) const = 0;
      virtual int  LineFromPosition( int position ) const = 0;
      virtual int  LineStart( int line ) const = 0;
      virtual int  GetLevel( int line ) const = 0;
      virtual int  SetLevel( int line, int level ) = 0;
      virtual int  GetLineState( int line ) const = 0;
      virtual int  SetLineState( int line, int state ) = 0;
      virtual void  StartStyling( int position, char mask ) = 0;
      virtual bool  SetStyleFor( int length, char style ) = 0;
      virtual bool  SetStyles( int length, const char *styles ) = 0;
      virtual void  DecorationSetCurrentIndicator( int indicator ) = 0;
      virtual void  DecorationFillRange( int position, int value, int fillLength ) = 0;
      virtual void  ChangeLexerState( int start, int end ) = 0;
      virtual int  CodePage() const = 0;
      virtual bool  IsDBCSLeadByte( char ch ) const = 0;
      virtual const char *  BufferPointer() = 0;
      virtual int  GetLineIndentation( int line ) = 0;

      virtual ~IDocument() {}

  };

  class IDocumentWithLineEnd : public IDocument {
    public:
      virtual int  LineEnd( int line ) const = 0;
      virtual int  GetRelativePosition( int positionStart, int characterOffset ) const = 0;
      virtual int  GetCharacterAndWidth( int position, int *pWidth ) const = 0;
  };

  enum { lvOriginal = 0, lvSubStyles = 1 };
  class ILexer {
    public:
      virtual ~ILexer() {}
      virtual int  Version() const = 0;
      virtual void  Release() = 0;
      virtual const char *  PropertyNames() = 0;
      virtual int  PropertyType( const char *name ) = 0;
      virtual const char *  DescribeProperty( const char *name ) = 0;
      virtual int  PropertySet( const char *key, const char *val ) = 0;
      virtual const char *  DescribeWordListSets() = 0;
      virtual int  WordListSet( int n, const char *wl ) = 0;
      virtual void  Lex( unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess ) = 0;
      virtual void  Fold( unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess ) = 0;
      virtual void *  PrivateCall( int operation, void *pointer ) = 0;
  };
  class ILexerWithSubStyles : public ILexer {
    public:
      virtual int  LineEndTypesSupported() = 0;
      virtual int  AllocateSubStyles( int styleBase, int numberStyles ) = 0;
      virtual int  SubStylesStart( int styleBase ) = 0;
      virtual int  SubStylesLength( int styleBase ) = 0;
      virtual int  StyleFromSubStyle( int subStyle ) = 0;
      virtual int  PrimaryStyleFromStyle( int style ) = 0;
      virtual void  FreeSubStyles() = 0;
      virtual void  SetIdentifiers( int style, const char *identifiers ) = 0;
      virtual int  DistanceToSecondaryStyles() = 0;
      virtual const char *  GetSubStyleBases() = 0;
  };
  class ILoader {
    public:
      virtual int  Release() = 0;
      virtual int  AddData( char *data, int length ) = 0;
      virtual void *  ConvertToDocument() = 0;
      virtual ~ILoader() {}
  };

  #ifdef SCI_NAMESPACE
}
  #endif

#endif
